package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpSROApprovalsPageUtil extends SeleniumPageUtil{
	public final static By SROA_TD_MENU = By.id("ctl44_pnlMenu");
	public final static By SROA_SPAN_POST = By.id("ctl44_btnPost");
	public final static By SROA_SPAN_CANCEL = By.id("ctl44_btnCancel");
	public final static By SROA_INPUT_CHECKBOX_REPORTS = By.id("ctl44_chkDirectReports");
	public final static By SROA_SPAN_MSG = By.id("ctl44_lblMsg");
	public final static By SROA_SPAN_HEADER = By.id("ctl44_lblHdr");
	public final static By SROA_TD_EXPENSES = By.xpath("//*[@id='ctl44_lblTransactionList']/table[1]/tbody/tr/td");
	
	public static void enterSROApprovalsPage() {
		SpHomePageUtil.enter();
		SpHomePageUtil.enterSROApprovalsPage();
	}
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				SROA_TD_MENU, SROA_SPAN_POST, SROA_SPAN_CANCEL, SROA_INPUT_CHECKBOX_REPORTS, SROA_SPAN_MSG, SROA_SPAN_HEADER, SROA_TD_EXPENSES
			});
		
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SROA_TD_MENU));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SROA_SPAN_POST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SROA_SPAN_CANCEL));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SROA_INPUT_CHECKBOX_REPORTS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SROA_SPAN_MSG));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SROA_SPAN_HEADER));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(SROA_TD_EXPENSES));
	}
}
